package scala.basic

import scala.io.StdIn

/**
 * 多层嵌套
 */
case object IfElseTest1 {
  def main(args: Array[String]): Unit = {
    println("input age:")
    var age = StdIn.readShort()
    var res: Any =
      if (age < 18) "童年"
      else {
        if (age >= 18) {
          if (age >= 19 && age < 30) "中年"
        }
        else "老年"
      }

    println(res)
  }
}
